#coding:utf-8
'''
Created on 2015年6月29日

@author: Administrator
'''
from collections import defaultdict
d=defaultdict(list)
d['a'].append(1)
d['b'].append(2)
d['c'].append(3)
print d['b'][0]
from collections import OrderedDict
d = OrderedDict()
d['foo']=1
d['bar']=2
d['spam']=4
import json
djson=json.dumps(d)
print djson

import thread

def run(n):
    # a back door, can not be run 4 times
    if n == 4:
        thread.exit()
    for i in range(n):
        print i
thread.start_new_thread(run,(5,))